FROM metax-megatron:2.23.0.13.342-ubuntu20.04-amd64
ENV PATH="/opt/conda/bin:${PATH}"
RUN /bin/bash -c "pip config set global.index-url http://repo.metax-tech.com/r/pypi/simple"

ENV MACA_PATH=/opt/maca

ENV MACA_CLANG_PATH=${MACA_PATH}/mxgpu_llvm/bin
ENV MACA_CLANG=${MACA_PATH}/mxgpu_llvm
ENV DEVINFO_ROOT=${MACA_PATH}
ENV CUDA_PATH=${MACA_PATH}/tools/cu-bridge
ENV CUDA_HOME=${CUDA_PATH}
ENV PATH=${MACA_PATH}/bin:${MACA_CLANG}/bin:${PATH}
ENV LD_LIBRARY_PATH=${MACA_PATH}/lib:${MACA_PATH}/mxgpu_llvm/lib:${LD_LIBRARY_PATH}

ENV ISU_FASTMODEL=1 
ENV USE_TDUMP=OFF 
ENV TMEM_LOG=OFF 
ENV DEBUG_ITRACE=0 

ENV MALLOC_THRESHOLD=99
ENV MCPYTORCH_CHECK_ANOMALY_INF=1
ENV FORCE_ACTIVATE_WAIT=1

#kernel selection
ENV MCBLAS_CUSTOMIZED_CONFIG_PATH=/workspace/Megatron-LM-FlagScale/mcblas_customized_config.yaml


ENV MCCL_MAX_NCHANNELS=16

ENV MCCL_P2P_LEVEL=SYS

ENV MCCL_LIMIT_RING_LL_THREADTHRESHOLDS=1
ENV MCPYTORCH_DISABLE_PRINT=1

ENV MHA_USE_BLAS=ON
ENV MHA_BWD_NO_ATOMIC_F64=1

ENV SET_DEVICE_NUMA_PREFERRED=1

ENV MCCL_IB_GID_INDEX=1
ENV MACA_SMALL_PAGESIZE_ENABLE=1
RUN /bin/bash -c "uname -a"
RUN /bin/bash -c alias python3=python
